package com.cheese.crowd.mvc.handle;

import com.cheese.crowd.entity.admin;
import com.cheese.crowd.service.api.adminService;
import com.cheese.crowd.service.impl.adminServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
@RequestMapping("/hello")
public class testController {
    @Autowired
    @Qualifier("adminServiceImpl")
    private adminService adminService;

    @RequestMapping("/ssm.html")
    public String testSsm(ModelMap modelMap){
        List<admin> adminList = adminService.getAll();
        modelMap.addAttribute("adminList",adminList);
        return "target";
    }
}
